import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()

// 查询党务分类树
export function tree (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-affairs-knowledge/typeTreeList`,
    method: 'get',
    params: data
  })
}

// 查询党务知识列表
export function queryByCondition (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-affairs-knowledge/list`,
    method: 'get',
    params: data
  })
}

// 新增党务知识
export function add (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-affairs-knowledge/add`,
    method: 'post',
    data
  })
}

// 编辑党务知识
export function edit (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-affairs-knowledge/edit`,
    method: 'post',
    data
  })
}

// 编辑党务知识
export function deleteById (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-affairs-knowledge/deleteById/${data.id}`,
    method: 'get',
    params: data
  })
}
